// Copyright (c) 2010 School of Software, Tsinghua University, Beijing (China)
// All rights reserved.
//
// This file is part of Geoxiom (http://code.google.com/p/geoxiom/); you may 
// redistribute it under the terms of the GNU Lesser General Public License.
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// Author(s) : Kan-Le Shi

#ifndef GEOXIOM_LEX_ANALYZER_HPP
#define GEOXIOM_LEX_ANALYZER_HPP

#include <fstream>
#include "stream.hpp"

namespace Geoxiom {
namespace Lex {

typedef class Analyzer {
public:
	Stream stream;

protected:
	// trim, conver to single form, and try to make the word mean.
	bool uniformize(Element &e) {
		throw "not implemented";
	}

public:
	bool clear() { stream.clear(); }

	// uniformize all elements in stream
	bool uniformize() {
		throw "not implemented";
	}

	bool process(const std::fstream &f, bool reset) {
		// read the file, and call the following method
		return true;
	}
	
	bool process(const std::string &s, bool reset) {
		if (reset)
			clear();
		// process the string
		// and put all elements elements into `stream'
		return true;
	}

public:
	Analyzer() : stream() { }
	~Analyzer() { }
} *AnalyzerPtr, *AnalyzerArray;

}
}

#endif